﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

using ScrumTable.Common.FileSystem;

namespace ScrumTable.Config.UserManagement
{

    #region Usings
    #endregion

    /// <summary>
    /// Represents a LoginAccountManager factory which creates
    /// LoginAccountManager instances. See <see cref="CreateUserManager()"/>
    /// </summary>
    public static class LoginAccountManagerFactory
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        #endregion

        #region Constructors / Destructor

        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------
 
        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        /// <summary>
        /// Creates the user manager.
        /// </summary>
        /// <returns></returns>
        public static LoginAccountManager CreateUserManager()
        {
            return CreateUserManager(DataFolderUtil.GetConfigFile("userList.xml"), DataFolderUtil.GetConfigUserPath("userList.xml"));
        }


        /// <summary>
        /// Creates the user manager.
        /// </summary>
        /// <returns></returns>
        public static LoginAccountManager CreateUserManager(string path, string userPath)
        {
            return new ConfigSerializer<LoginAccountManager>(path, userPath).Deserialize();
        }

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }
}
